﻿using BookManage.DAL;
using BookManage.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace BookManage.BLL
{
    public class ReaderAdmin
    {
        public static Reader GetReader(int rdID)  //系统根据借书证号获取读者对象
        {
            return (ReaderDAL.GetObjectByID(rdID));
        }
        public DataTable GetAllReaderType()
        {
            return (ReaderTypeDAL.GetAll());
        }
        public DataTable GetAllReader()
        {
            return (ReaderDAL.GetAllReader());
        }

        public DataTable GetReader(int rdType, string rdDept, string rdName)
        {
            return (ReaderDAL.GetReader(rdType, rdDept, rdName));
        }  //根据类别，专业，姓名检索
        public int Add(Reader reader)
        {
            return (ReaderDAL.Add(reader));
        } //添加

        public static DataTable GetAll(int rdID)
        {
            return (ReaderDAL.GetAll(rdID));
        }

        public int Update(Reader reader)
        {
            return (ReaderDAL.Update(reader));
        }  //更新

        public int Loss(Reader reader)
        {
            return (ReaderDAL.Loss(reader));
        }  //挂失
          
        public int UnLoss(Reader reader)
        {
            return (ReaderDAL.UnLoss(reader));
        }  //解除挂失

        public int Delete(Reader reader)  //注销
        {
            return (ReaderDAL.Delete(reader));
        }

        public DataTable GetReaderByRD(int rdID, string rdName)
        {
            return (ReaderDAL.GetReaderByRD(rdID,rdName));
        }

        public int ChangePwd(Reader readerPwd)
        {
            return (ReaderDAL.ChangePwd(readerPwd));
        }


        public static DataTable GetLastRdID()
        {
            return (ReaderDAL.GetLastRdID());
        }

        public static int IsFindReader(int rdID)
        {
            return (ReaderDAL.IsFindReader(rdID));
        }
    }
}
